use rocket::serde::json::Json;
use crate::extends::core::errors::response_code_enums::ResponseCodeEnum;
use crate::extends::core::response::reponse_data::R;

// Default 404 handler
#[catch(404)]
pub fn not_found() -> Json<R<String>> {
    R::error(ResponseCodeEnum::NOT_FOUND)
}

// Custom error handler for 500 responses
#[catch(500)]
pub fn internal_error() -> Json<R<String>> {
    R::error(ResponseCodeEnum::INTERNAL_SERVER_ERROR)
}
